package by.pavlyukevich.paymentsystem.services;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import by.pavlyukevich.paymentsystem.dataaccess.filter.Filter;
import by.pavlyukevich.paymentsystem.datamodel.AbstractEntity;

public interface AbstractService<ID, Entity extends AbstractEntity<ID>> {
	Entity get(ID id);

	@Transactional
	void saveOrUpdate(Entity entity);

	@Transactional
	void delete(Entity entity);

	@Transactional
	void deleteAll();

	List<Entity> getList(Filter<Entity> filter);

	public long getCount(Filter<Entity> filter);

	List<Entity> getList();

	public long getCount();

}
